package com.fengze.business.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

public class ProjectInfoVO implements Serializable {

    private Long id;

    private String name;

    private String code;


    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    public Date getEndTime() {
        return endTime;
    }

    /**
     * 是否预期标志 0 正常  1逾期
     */
    private Integer flag;

    public Integer getFlag() {
        if(this.status == 1){
            return 0;
        }

        int compare = this.endTime.compareTo(new Date());
        if(compare < 0){
            return 1;
        }

        return 0;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
